/**
 * @file    PluginTest.h
 * @brief   
 *          
 *          In Windows they're known as DLLs; in Unix they're shared libraries
 *          
 ****************************************************************************
 * @version $Id: PluginTest.h 2327 2010-04-23 04:39:07Z alex $
 * @author  Alessandro Polo
 ****************************************************************************/
/* Copyright (c) 2007-2010, WOSH - Wide Open Smart Home 
 * by Alessandro Polo - OpenSmartHome.com
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the OpenSmartHome.com WOSH nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY Alessandro Polo ''AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL Alessandro Polo BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ****************************************************************************/

/*
g++ -fPIC -shared Plugin.cpp -o myclass.so
g++ main.cpp -ldl -o sample
*/

#ifndef __WOSH_Plugins_PluginTest_H__
 #define __WOSH_Plugins_PluginTest_H__

 #include <framework/plugins/Plugin.h>
 #include <core/Object.h>

 
namespace wosh {
 namespace plugins {

class MyTestObject;

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

WOSH_EXPORT_API void gather_library_information( PluginInformation* data ) {
	if ( data == NULL) return;

	memset(data->library_name, 0, 255);
	strcpy(data->library_name, "PluginTest");

	memset(data->library_uuid, 0, 255);
	strcpy(data->library_uuid, "");

	memset(data->library_author, 0, 255);
	strcpy(data->library_author, "Alessandro Polo <contact@alessandropolo.name>");

	data->version_mayor = 0.0;
	data->version_minor = 1;

	data->objects_type_count = 1;
	data->objects_type = new char*[1];

	data->objects_type[0] = new char[32];
	memset(data->objects_type[0], 0, 32);
	strcpy(data->objects_type[0], "MyTestObject");

 }

//////////////////////////////////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////////////////////////////////

WOSH_EXPORT_API IReflection* create_object( const char* object_type );

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

WOSH_EXPORT_API void destroy_object( IReflection* object ) {
	if ( object == NULL) return;
	delete object;
 }

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

class MyTestObject : public Object {
	public:
		MyTestObject();
		virtual ~MyTestObject();

};

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

 }; // namespace plugins
}; // namespace wosh

#endif //__WOSH_Plugins_PluginTest_H__
